package com.wmjsoft

import com.wmjsoft.handler.ShowRouteHandler
import com.wmjsoft.plugins.nutzplugin.NutzPlugin
import com.wmjsoft.plugins.security.SecurityPlugin
import com.wmjsoft.plugins.security.handler.SecurityHandler
import io.vertx.core.Handler
import net.cloudopt.next.web.NextServer
import net.cloudopt.next.web.Worker
import net.cloudopt.next.web.event.EventPlugin

/**
 * 如果我没有写注释，请提醒我
 * @program: Maternal
 * @description:
 * @author: Mr.Lee
 * @create: 2021-02-19 10:05
 */
fun main(args:Array<String>) {
    NextServer.addPlugin(EventPlugin())
    NextServer.addPlugin(NutzPlugin())
    NextServer.addPlugin(SecurityPlugin())
    NextServer.addHandler(ShowRouteHandler())
    NextServer.addHandler(SecurityHandler())
    NextServer.run()
    Worker.setTimer(1000,false, Handler { id ->
        println("And one second later that is printed")
    })
    Worker.cancelTimer(1)
}